package com.grocerific.order;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class OrderMapper implements RowMapper<Order>{

	@Override
	public Order mapRow(ResultSet resultSet, int rowNumber) throws SQLException {
		Order order = new Order();
		order.setId(resultSet.getInt("id"));
		order.setOrderDate(resultSet.getString("order_date"));
		order.setTotal(resultSet.getFloat("total"));
		return order;
	}
}
